/*
 * asscache.h
 *
 *  Created on: Apr 17, 2012
 *      Author: Tim
 */

#ifndef ASSCACHE_H_
#define ASSCACHE_H_

#include "cache.h"

typedef struct lruNode
{
	struct lruNode* next;
	struct lruNode* prev;

	uint32 way;
} lruNode;

typedef struct
{
	boolean* valids;
	boolean* dirtys;
	uint32 ways;
	uint32* tags;
	// This is the LRU node that is the beginning of the link list and changes with acceses
	lruNode* firstLruNode;
	// This is a pointer to the first LRU node in memory, so that they may be accessed by way
	lruNode* lruNodeList;
}asscacheset;

boolean createAssCache(cache_s* cache);
boolean deleteAssCache(cache_s* cache);
boolean checkAssCache(cache_s* cache, uint32 reference, boolean isWrite);
kickout addValueToAssCache(cache_s* cache, uint32 reference, boolean isWrite);

#endif /* ASSCACHE_H_ */
